import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, IsBoolean } from 'class-validator';

/**
 * Device metadata model (version 1)
 * Contains detailed information about device hardware and software
 */
export class DeviceMetaModelV1 {
  @ApiProperty({
    description: '设备屏幕分辨率',
    example: '1080x2356',
  })
  @IsString()
  @IsOptional()
  resolution?: string;

  @ApiProperty({
    description: '设备是否已root',
    example: false,
  })
  @IsBoolean()
  @IsOptional()
  root?: boolean;

  @ApiProperty({
    description: '是否为模拟器',
    example: true,
  })
  @IsBoolean()
  @IsOptional()
  simulator?: boolean;

  @ApiProperty({
    description: 'CPU的ABI类型',
    example: 'armeabi-v7aarmeabiarm64-v8a',
  })
  @IsString()
  @IsOptional()
  cpuABI?: string;

  @ApiProperty({
    description: '设备基板名称',
    example: 'cezanne',
  })
  @IsString()
  @IsOptional()
  board?: string;

  @ApiProperty({
    description: '设备品牌',
    example: 'Redmi',
  })
  @IsString()
  @IsOptional()
  brand?: string;

  @ApiProperty({
    description: '设备硬件代码',
    example: 'cezanne',
  })
  @IsString()
  @IsOptional()
  device?: string;

  @ApiProperty({
    description: '系统显示的构建版本字符串',
    example: 'SP1A.210812.016',
  })
  @IsString()
  @IsOptional()
  display?: string;

  @ApiProperty({
    description: '构建系统镜像的主机名称',
    example: 'non-pangu-pod-vpvmh',
  })
  @IsString()
  @IsOptional()
  host?: string;

  @ApiProperty({
    description: '系统构建的唯一标识符',
    example: 'SP1A.210812.016',
  })
  @IsString()
  @IsOptional()
  id?: string;

  @ApiProperty({
    description: '设备实际制造商名称',
    example: 'Xiaomi',
  })
  @IsString()
  @IsOptional()
  manufacturer?: string;

  @ApiProperty({
    description: '设备用户可见的型号名称',
    example: 'M2006J10C',
  })
  @IsString()
  @IsOptional()
  model?: string;

  @ApiProperty({
    description: '设备产品内部代码',
    example: 'cezanne',
  })
  @IsString()
  @IsOptional()
  product?: string;

  @ApiProperty({
    description: '系统构建标签',
    example: 'release-keys',
  })
  @IsString()
  @IsOptional()
  tags?: string;

  @ApiProperty({
    description: '系统构建类型',
    example: 'user',
  })
  @IsString()
  @IsOptional()
  type?: string;

  @ApiProperty({
    description: '构建系统镜像的用户名',
    example: 'builder',
  })
  @IsString()
  @IsOptional()
  user?: string;
}
